<div class='logo' style='min-width:1024px'>
	<div style="height:82px;width:100%;" align="center">
		<div class="main_tool_div" id="main_tool_con">
			<li class="main_tool_a" callFunc="click:quitLoad">注销</a>
			<li class="main_tool_a" callFunc="click:quitSys">退出系统</a>
			<li class="main_tool_a" callFunc="click:viewHelp">帮助信息</a>
			<li callFunc="click:servCenter">服务中心</a>
		</div>
		<div class='main_role_div'>
			<label>角色：</label>
			<li id='roleSpan'><div class='checkItem'></div><div class="form_list" callfunc="click:changeRole" datakey="name"></div></li>
			<label>公司：</label>
			<li id='comSpan'><div class='checkItem'></div><div class="form_list" callfunc="click:changeCom" datakey="name"></div></li>
		</div>
	</div>
	<div style='text-align:center;padding-bottom:3px;height:22px'>
		<div class="welcome" id="login_info">
			<span id="main_tool_span" class="main_tool_span"> 
				<label>工程名称:</label>
				<input id="name" size='25' clickType=0 callFunc="keydown:doQry()" />
				<button class='jxd_btn' callFunc="click:qryProjectByCondition">搜索</button>
				<button class="jxd_btn" callFunc="click:qryProject4Me">搜自己</button>
			</span>
			<li id="jxd_time_span" class="jxd_white" style="float:right"></li>
		</div>
	</div>
</div>
<script>
var jxd_time=null;
var userInfo=null;
yanhx.addCommon("load",function(){
	$.java({
		action:"main.load",
		callback:function(data){
			$("#jxd_title").text("您好！"+data.name);
			userInfo=data;
			fillRoleAndCom();
		}
	});
	jxd_time=$("#jxd_time_span");
	window.setInterval(showTime,1000);
});
function fillRoleAndCom(){
	var roleSpan=$("#roleSpan");
	roleSpan.children(".form_list").list(userInfo.role,true);
	var comSpan=$("#comSpan");
	comSpan.children(".form_list").list(userInfo.com,true);
	roleSpan.children(".checkItem").text(roleSpan.children(".form_list")
	.children("#l_"+userInfo.curRole).text());
	comSpan.children(".checkItem").text(comSpan.children(".form_list")
	.children("#l_"+userInfo.curCom).text());
}
function showTime(){
	var d=new Date();
	jxd_time.text(d.toDateString());
}
yanhx.addFunc("changeRole",function(){
	var src=$src();
	if(src.attr("id")==("l_"+userInfo.curRole)){
		src.parent().hide();
	}
	else{
		$.java({
			action:"main.changeRole",
			param:{role_id:src.attr("id").replace("l_","")},
			callback:function(data){
				
			}
		});
	}
});
yanhx.addFunc("changeCom",function(){
	var src=$src();
	if(src.attr("id")==("l_"+userInfo.curCom)){
		src.parent().hide();
	}
	else{
		$.java({
			action:"main.changeCom",
			param:{role_id:src.attr("id").replace("l_","")},
			callback:function(data){
				
			}
		});
	}
});
</script>